﻿@model RH.Web.ViewModels.UtilityModels.ListConfig
@using RH.Web.Utility;
@using RH.Web.ViewModels
@{
    ListConfig config = RH.Web.ViewModels.UtilityModels.ListConfigBuilder.Build(
                @"{ Start Date | End Date  }, 
                {Committed Leads | Leads Sent}",
                Model.DataSource, "EditSP({0})");
                //"javascript:void(0); MakeUser({0},'{1}')");
    if (Model != null) { 
        ListConfig.Map(config, Model);
        String anchor = "<a class=\"btn btn-{0} btn-sm\" href=\"javascript:void(0);\" onclick=\"{1};\" title=\"{2}\"><i class=\"glyphicon glyphicon-{3}\"></i> {4}</a>";
        Column editColumn = config.EditColumn;
        editColumn.Method = P =>
        {
            int id = RH.Common.DB.NullHandler.GetInt(P["ID"]);
            System.Text.StringBuilder sb = new System.Text.StringBuilder(10);
            sb.AppendFormat(anchor, "default", String.Format("EditSS({0}, this)", id), "Edit this Span", "edit", String.Empty);
            sb.AppendFormat(anchor, "warning", String.Format("DeleteConfirm({0}, this, _DelCnfMsg)", id), "Delete this Span", "remove", String.Empty);
            return MvcHtmlString.Create(sb.ToString());
        };
    }
}
@if (Model != null)
{
    @Html.Partial("_DataTableList", Model)
}

    


